package _28define.udp;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Sender {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket=new DatagramSocket(8888);
        String s="hello";
        InetAddress targetIP=InetAddress.getByName("192.168.106.143");
        int port=9999;
        byte[] bytes=s.getBytes();
        DatagramPacket sendPacket=new DatagramPacket(bytes,0,bytes.length,targetIP,port);
        datagramSocket.send(sendPacket);
        datagramSocket.close();

    }
}
